#include <stdio.h>
#include <math.h>

int main()
{
    double sum = 0;
    int n = 0;
    int i;
    int flag = 1;
    scanf("%d", &n);
    for(i = 0;i < n;i ++)
    {
        if(flag)sum += (double)1/(double)(3*i+1);
        else sum -= (double)1/(double)(3*i+1);
        if(flag == 0)flag = 1;
        else flag = 0;
    }
    printf("%.3lf\n", sum + 0.0005);
    return 0;
}